/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * supervision_tareas_programacion.java
 *
 * Created on 14/04/2011, 08:31:23 PM
 */

package sie_invdis;


import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;

import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.RefineryUtilities;

/**
 *
 * @author Michelle
 */
public class supervision_tareas_programacion extends javax.swing.JFrame {

    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_cattareas;
    private JTable jtable_tiendas;
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    private int controlcomboasi=0;
      bd_conexion x = new bd_conexion() ;
       //se creaa la variable resultset
       ResultSet rs = null;
    /** Creates new form supervision_tareas_programacion */
    public supervision_tareas_programacion() {
        this.iniciar_modelo_artiyesta();
        initComponents();
        //x.estableceConexion();

    java.util.Date fecha=new Date();
    this.jdc_fechainicial.setDate(fecha);
        
    jt_cattareas.getColumnModel().getColumn(0).setPreferredWidth(50);//Folio
    jt_cattareas.getColumnModel().getColumn(1).setPreferredWidth(30);//status
    jt_cattareas.getColumnModel().getColumn(2).setPreferredWidth(60);//doc ant.
    jt_cattareas.getColumnModel().getColumn(3).setPreferredWidth(45);//fecha
    jt_cattareas.getColumnModel().getColumn(4).setPreferredWidth(150);//f.recepcion
    jt_cattareas.getColumnModel().getColumn(5).setPreferredWidth(40);//Dias Trans.
    jt_cattareas.getColumnModel().getColumn(6).setPreferredWidth(130);//Cliente
    jt_cattareas.getColumnModel().getColumn(7).setPreferredWidth(30);//piezas

    jt_cattareas.getTableHeader().setBackground(Color.yellow);

        this.cargar_datoscata_tareas(0,"",variables_global.getdepartamento());
        this.loadcombodepa();
        this.loadcombotipo();
        this.loadcomboprioridad();
        this.loadcombodepa_clasif();
        controlcomboasi=1;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jbtn_salir = new javax.swing.JButton();
        jbtn_actualiza = new javax.swing.JButton();
        jbtn_grafica = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jcmbox_depart = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jdc_fechainicial = new com.toedter.calendar.JDateChooser();
        jLabel3 = new javax.swing.JLabel();
        jtf_horarealiza = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jbtn_guardar = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jta_descripcion = new javax.swing.JTextArea();
        jcmbx_tipo = new javax.swing.JComboBox();
        jcmbx_Prioridad = new javax.swing.JComboBox();
        jcmbx_depaclasif = new javax.swing.JComboBox();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_cattareas = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel4 = new javax.swing.JPanel();
        jcmbx_asignadoa = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jcbx_verpendienteshoy = new javax.swing.JCheckBox();
        jCheckBox1 = new javax.swing.JCheckBox();
        jcbx_pendientes = new javax.swing.JCheckBox();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jmni_actualizar = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(supervision_tareas_programacion.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setName("jPanel1"); // NOI18N

        jbtn_salir.setIcon(resourceMap.getIcon("jbtn_salir.icon")); // NOI18N
        jbtn_salir.setText(resourceMap.getString("jbtn_salir.text")); // NOI18N
        jbtn_salir.setName("jbtn_salir"); // NOI18N
        jbtn_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_salirActionPerformed(evt);
            }
        });

        jbtn_actualiza.setIcon(resourceMap.getIcon("jbtn_actualiza.icon")); // NOI18N
        jbtn_actualiza.setText(resourceMap.getString("jbtn_actualiza.text")); // NOI18N
        jbtn_actualiza.setName("jbtn_actualiza"); // NOI18N
        jbtn_actualiza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_actualizaActionPerformed(evt);
            }
        });

        jbtn_grafica.setIcon(resourceMap.getIcon("jbtn_grafica.icon")); // NOI18N
        jbtn_grafica.setText(resourceMap.getString("jbtn_grafica.text")); // NOI18N
        jbtn_grafica.setName("jbtn_grafica"); // NOI18N
        jbtn_grafica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_graficaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jbtn_actualiza, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jbtn_grafica)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 635, Short.MAX_VALUE)
                .addComponent(jbtn_salir, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jbtn_salir)
                .addComponent(jbtn_actualiza)
                .addComponent(jbtn_grafica))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jcmbox_depart.setToolTipText(resourceMap.getString("jcmbox_depart.toolTipText")); // NOI18N
        jcmbox_depart.setName("jcmbox_depart"); // NOI18N
        jcmbox_depart.setNextFocusableComponent(jdc_fechainicial);

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jdc_fechainicial.setToolTipText(resourceMap.getString("jdc_fechainicial.toolTipText")); // NOI18N
        jdc_fechainicial.setDateFormatString(resourceMap.getString("jdc_fechainicial.dateFormatString")); // NOI18N
        jdc_fechainicial.setName("jdc_fechainicial"); // NOI18N
        jdc_fechainicial.setNextFocusableComponent(jtf_horarealiza);
        jdc_fechainicial.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jdc_fechainicialKeyPressed(evt);
            }
        });

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jtf_horarealiza.setText(resourceMap.getString("jtf_horarealiza.text")); // NOI18N
        jtf_horarealiza.setToolTipText(resourceMap.getString("jtf_horarealiza.toolTipText")); // NOI18N
        jtf_horarealiza.setName("jtf_horarealiza"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jbtn_guardar.setIcon(resourceMap.getIcon("jbtn_guardar.icon")); // NOI18N
        jbtn_guardar.setText(resourceMap.getString("jbtn_guardar.text")); // NOI18N
        jbtn_guardar.setName("jbtn_guardar"); // NOI18N
        jbtn_guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_guardarActionPerformed(evt);
            }
        });

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jta_descripcion.setColumns(20);
        jta_descripcion.setRows(5);
        jta_descripcion.setToolTipText(resourceMap.getString("jta_descripcion.toolTipText")); // NOI18N
        jta_descripcion.setName("jta_descripcion"); // NOI18N
        jta_descripcion.setNextFocusableComponent(jcmbx_tipo);
        jScrollPane2.setViewportView(jta_descripcion);

        jcmbx_tipo.setToolTipText(resourceMap.getString("jcmbx_tipo.toolTipText")); // NOI18N
        jcmbx_tipo.setName("jcmbx_tipo"); // NOI18N
        jcmbx_tipo.setNextFocusableComponent(jcmbx_Prioridad);
        jcmbx_tipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcmbx_tipoActionPerformed(evt);
            }
        });

        jcmbx_Prioridad.setToolTipText(resourceMap.getString("jcmbx_Prioridad.toolTipText")); // NOI18N
        jcmbx_Prioridad.setName("jcmbx_Prioridad"); // NOI18N

        jcmbx_depaclasif.setToolTipText(resourceMap.getString("jcmbx_depaclasif.toolTipText")); // NOI18N
        jcmbx_depaclasif.setName("jcmbx_depaclasif"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jcmbox_depart, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jdc_fechainicial, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 309, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_horarealiza, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jcmbx_Prioridad, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jcmbx_tipo, javax.swing.GroupLayout.Alignment.LEADING, 0, 90, Short.MAX_VALUE))
                        .addGap(20, 20, 20)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jcmbx_depaclasif, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jbtn_guardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(jcmbox_depart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2))
                    .addComponent(jdc_fechainicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(jtf_horarealiza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jcmbx_tipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jcmbx_depaclasif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jcmbx_Prioridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jbtn_guardar)))
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jt_cattareas.setModel(this.jtable_modelo_cattareas);
        jt_cattareas.setName("jt_cattareas"); // NOI18N
        jt_cattareas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_cattareasMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane1.setViewportView(jt_cattareas);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 947, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE)
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jcmbx_asignadoa.setName("jcmbx_asignadoa"); // NOI18N
        jcmbx_asignadoa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcmbx_asignadoaActionPerformed(evt);
            }
        });

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jcbx_verpendienteshoy.setText(resourceMap.getString("jcbx_verpendienteshoy.text")); // NOI18N
        jcbx_verpendienteshoy.setName("jcbx_verpendienteshoy"); // NOI18N
        jcbx_verpendienteshoy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbx_verpendienteshoyActionPerformed(evt);
            }
        });

        jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
        jCheckBox1.setName("jCheckBox1"); // NOI18N
        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox1ActionPerformed(evt);
            }
        });

        jcbx_pendientes.setText(resourceMap.getString("jcbx_pendientes.text")); // NOI18N
        jcbx_pendientes.setName("jcbx_pendientes"); // NOI18N
        jcbx_pendientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbx_pendientesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jcmbx_asignadoa, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jcbx_verpendienteshoy)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCheckBox1))
                    .addComponent(jcbx_pendientes))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jcmbx_asignadoa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcbx_verpendienteshoy, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jcbx_pendientes)
                .addContainerGap(25, Short.MAX_VALUE))
        );

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem1.setIcon(resourceMap.getIcon("jMenuItem1.icon")); // NOI18N
        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenu1.add(jMenuItem1);

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem2);

        jmni_actualizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, 0));
        jmni_actualizar.setIcon(resourceMap.getIcon("jmni_actualizar.icon")); // NOI18N
        jmni_actualizar.setText(resourceMap.getString("jmni_actualizar.text")); // NOI18N
        jmni_actualizar.setName("jmni_actualizar"); // NOI18N
        jmni_actualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_actualizarActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_actualizar);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtn_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_salirActionPerformed
        // TODO add your handling code here:
        //x.cierraConexion();   // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
}//GEN-LAST:event_jbtn_salirActionPerformed

    private void jdc_fechainicialKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jdc_fechainicialKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jdc_fechainicialKeyPressed

private void iniciar_modelo_artiyesta()
    {

        jtable_modelo_cattareas=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_cattareas.addColumn("<html><b>Priori/Status</b></html>");
        jtable_modelo_cattareas.addColumn("<html><b>id/Tipo.</b></html>");
        jtable_modelo_cattareas.addColumn("<html><b>Departamento</b></html>");
        jtable_modelo_cattareas.addColumn("<html><b>F.Programada</b></html>");
        jtable_modelo_cattareas.addColumn("<html><b>Descripcion Tarea</b></html>");
        jtable_modelo_cattareas.addColumn("<html><b>F.Realizada</b></html>");
        jtable_modelo_cattareas.addColumn("<html><b>Comentarios de Tarea</b></html>");
        jtable_modelo_cattareas.addColumn("<html><b>Calificacion</b></html>");
   }



private void cargar_datoscata_tareas(int opcion,String texbuesqueda,String depaglobal)
{
     
            String texto="",texto2="";
            java.util.Date fechainicial=new Date();
            ResultSet rs2 = null;
             float importe=0,importe2=0,acumulado=0,priori=0,califica=0;
            DecimalFormat myForma = new DecimalFormat("###,###,###,###");
            String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="",diasem="";
            this.LimpiarJTable();
            Object[] fnewRow = new Object[8];
                 importe=0;
                 texto2="select * from x1_supervision_tareas_catalogo('"+depaglobal+"',"+opcion+",'"+texbuesqueda+"') as (folio integer,fecha_alta_pro timestamp without time zone,docto_agrupar character varying(16),descripcion_tarea text,fecha_a_realizar text,hora_realizar character varying(16),fecha_alta_reali timestamp without time zone,fecha_realizada text,hora_realizada character varying(16),descripcion_ejecuciontarea text,personal_realizo text,imagenes_tarea text,observaciones_tareasrealizadas text,status_tarea smallint,calificacion_tarea smallint,departamento_o_tienda smallint,tipo smallint,prioridad smallint,tipo_descrip character varying(25),status_descrip character varying(25),cali_descrip character varying(25),descripcion_depa character varying(80),prio_descrip character varying(25),deporigen smallint,fotos_origen character varying(255));";

                            System.out.println(texto2);
                            try{
                                  rs2 = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                                  while (rs2.next())
                                    {
                                            diasem="";
                                            priori=rs2.getInt("prioridad");
                                            colorabre="";
                                            colorcierra="";
                                            if (priori>=11)
                                                {
                                                    colorabre="<b><font color=#CC0000>";
                                                    colorcierra="<font></b>";
                                                }
                                            else
                                                {
                                                    colorabre="<b><font color=#00FF00>";
                                                    colorcierra="<font></b>";
                                                }
                                      fnewRow[0]="<html><h4><b>"+colorabre+rs2.getString("prio_descrip")+"<br>"+rs2.getString("status_descrip")+colorcierra+"</b></h4></html>";
                                      fnewRow[1]=""+rs2.getString("folio")+":"+rs2.getString("tipo_descrip");
                                      fnewRow[2]="<html><p align=justify>"+rs2.getString("descripcion_depa")+"</p></html>";
                                      fnewRow[3]="<html><p align=justify>"+rs2.getString("fecha_a_realizar")+"<br>"+this.DiaSemana(rs2.getString("fecha_a_realizar"))+"<br>"+rs2.getString("hora_realizar")+"</p></html>";
                                      
                                      fnewRow[4]="<html><p align=justify>"+rs2.getString("descripcion_tarea")+"</p></html>";
                                      if(rs2.getString("fecha_realizada") != null )
                                            {
                                           diasem= this.DiaSemana(rs2.getString("fecha_realizada"));
                                            }
                                      fnewRow[5]="<html><p align=justify>"+rs2.getString("fecha_realizada")+"<br>"+diasem+"<br>"+rs2.getString("hora_realizada")+"</p></html>";
                                      
                                      fnewRow[6]="<html><p align=justify>"+rs2.getString("descripcion_ejecuciontarea")+"</p></html>";

                                      califica=rs2.getInt("calificacion_tarea");
                                      colorabre="";
                                      colorcierra="";
                                         if ((califica<6) && (califica>0))
                                                {
                                                    colorabre="<b><font color=#CC0000>";
                                                    colorcierra="<font></b>";
                                                }
                                     if  (califica>5)
                                                {
                                                    colorabre="<b><font color=#00FF00>";
                                                    colorcierra="<font></b>";
                                                }

                                      fnewRow[7]="<html><p align=justify>"+colorabre+rs2.getString("cali_descrip")+colorcierra+"</p></html>";

                                      
                                      jtable_modelo_cattareas.addRow(fnewRow);
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
this.cambiartamanofilas();


}

void LimpiarJTable()
    {
     //limpiar la tabla
        while(jtable_modelo_cattareas.getRowCount()>0)jtable_modelo_cattareas.removeRow(0);
    }
 void cambiartamanofilas()
 {
     //limpiar la tabla


       int numerofilas=this.jtable_modelo_cattareas.getRowCount();

             for(int i = 0 ;i < numerofilas; i++)
                {
                     jt_cattareas.setRowHeight(i, 80);
                }
  }
    private void jbtn_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
          this.agregartarea();
        } else {
            //this.jtf_clave.requestFocus();
        }

    }//GEN-LAST:event_jbtn_guardarActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
    if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
        {
            this.dispose();
        }
        
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jbtn_actualizaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_actualizaActionPerformed
        // TODO add your handling code here:
        this.cargar_datoscata_tareas(0,"",variables_global.getdepartamento());

}//GEN-LAST:event_jbtn_actualizaActionPerformed

    private void jmni_actualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_actualizarActionPerformed
        // TODO add your handling code here:
        this.jbtn_actualizaActionPerformed(evt);
    }//GEN-LAST:event_jmni_actualizarActionPerformed

    private void jbtn_graficaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_graficaActionPerformed
        // TODO add your handling code here:
        this.contruir_graficapromedios();
    }//GEN-LAST:event_jbtn_graficaActionPerformed

    private void jcmbx_asignadoaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmbx_asignadoaActionPerformed
        // TODO add your handling code here:
         if(controlcomboasi==1)
           {
            if(JOptionPane.showConfirmDialog(null, "Desea Ver las Tareas de este departamento?")==0) {
                String arreglo_depasi[]=this.jcmbx_asignadoa.getSelectedItem().toString().split(":");
                this.cargar_datoscata_tareas(3,arreglo_depasi[0],variables_global.getdepartamento());
            }

           }
    }//GEN-LAST:event_jcmbx_asignadoaActionPerformed

    private void jcbx_verpendienteshoyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_verpendienteshoyActionPerformed
        // TODO add your handling code here:
          if(JOptionPane.showConfirmDialog(null, "Desea Ver las Tareas Pendientes de hoy?")==0) {
                java.util.Date fechaeuro=new Date();
                this.cargar_datoscata_tareas(4,this.fechaeuropea(fechaeuro),variables_global.getdepartamento());
          }
        

    }//GEN-LAST:event_jcbx_verpendienteshoyActionPerformed

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        // TODO add your handling code here:
           if(JOptionPane.showConfirmDialog(null, "Desea Ver las Tareas en Proceso?")==0) {

                this.cargar_datoscata_tareas(5,"",variables_global.getdepartamento());
          }

    }//GEN-LAST:event_jCheckBox1ActionPerformed

    private void jcbx_pendientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_pendientesActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Ver Todas las Pendientes?")==0) {

                this.cargar_datoscata_tareas(6,"",variables_global.getdepartamento());
          }

    }//GEN-LAST:event_jcbx_pendientesActionPerformed

    private void jcmbx_tipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmbx_tipoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jcmbx_tipoActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem2ActionPerformed
 private void contruir_graficapromedios()
    {
        //inicio a extraer los totales del dia sin incluir monedero es decir al reporte detalle corte
        //contruyo el grafico de lineas del cortes del dia detalle

         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="";

            rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_promedios() as (id smallint,ntar bigint,suma bigint,prom bigint, descrip character varying(80));",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                        totaltiendatexto = rs.getString("prom");
                        titulografico=rs.getString("id")+":"+rs.getString("descrip");

                        datasetbarra.addValue(Float.valueOf(totaltiendatexto.replace(",","").replace(".","")),titulografico,"Departamentos");
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }

         System.out.println("se crea nuevo:");
        graficacion_varios_barras gvbvenxmes = new graficacion_varios_barras("Sistema Integral: Promedios de Tareas x Departamento",datasetbarra,"Promedios x Departamento","Meses");
        gvbvenxmes.pack();
        RefineryUtilities.centerFrameOnScreen(gvbvenxmes);
        gvbvenxmes.setVisible(true);

     }

 private void jt_cattareasMouseClicked(java.awt.event.MouseEvent evt) {                                          
        // TODO add your handling code here:
    }  

    private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:

         System.out.println("dio doble  click");
                int columna =jt_cattareas.getSelectedColumn();
                
                int fila = jt_cattareas.getSelectedRow();
                String arreglo_clave[] = jt_cattareas.getValueAt(fila, 1).toString().split(":");
                System.out.println("dio doble  click Sobre="+jt_cattareas.getValueAt(fila, 1).toString()+" "+arreglo_clave[0]);
                 JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
                 supervision_tareas_edita fste=new supervision_tareas_edita(mainFrame,true,Integer.valueOf(arreglo_clave[0]));
                 fste.setVisible(true);

        //setVisible(false);
    }

     private void loadcombodepa_clasif(){

          rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_depar_clasif() as (id smallint,descrip character varying(25));",variables_global.getconexiongral());
            try
            {
                this.jcmbx_depaclasif.addItem("0:Agrupar Tareas");
               while (rs.next())
                    {
                      this.jcmbx_depaclasif.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }



    }

private void loadcombodepa(){
        
          rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_departamentos() as (id smallint,descrip character varying(80));",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                      this.jcmbox_depart.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                      this.jcmbx_asignadoa.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                      
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         

         
    }
private void loadcombotipo(){
        
          rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_tipos() as (id smallint,descrip character varying(80));",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                      this.jcmbx_tipo.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         

         
    }

private void loadcomboprioridad(){

          rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_prioridad() as (id smallint,descrip character varying(80));",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                      this.jcmbx_Prioridad.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }



    }


private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
       private String  fechaeuropea(Date fecha) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";

       cadenafecha= formateadorestaeuropa.format(fecha);
       return cadenafecha;

    }
     private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }

        private  void ayuda()
            {
                JOptionPane.showMessageDialog(null," 1.-Catalogo de Recepciones de Mercancia, cada una de las Opciones se autodescribe brevemente\n 2.- Cada Boton tiene Una letra Resaltada el cual indica su metodo abreviado, uselo si desea mayor rapides ( ejemplo Alt+a obtendra ayuda automaticamente)\n 3.- Para ver Detalle de un documento de Doble clik sobre el registro sombreado o use las teclas arriba o abajo luego precione enter y aparecera otra pantalla. \n ", "Sistema Integral(Detalle Recepcion) : Ayuda",1);
            }

        private void crearcomentario()
          {
                 String retorno="";

        String comentario=JOptionPane.showInputDialog("Ingresa Tu Sugerencia o Comentario:");
        if (comentario.length()>0)
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_bitacorainserta('"+comentario+"', 'Catalogo Recepciones');",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                         retorno=rs.getString(1);
                   }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
            if (retorno.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias Tu comentario ha sido guardado", "Sistema Integral Comentarios",1);

              }

      }
    }
private void agregartarea(){

        String arreglo_dep[]=this.jcmbox_depart.getSelectedItem().toString().split(":");
        String arreglo_tipo[]=this.jcmbx_tipo.getSelectedItem().toString().split(":");
        String arreglo_priori[]=this.jcmbx_Prioridad.getSelectedItem().toString().split(":");
        String arreglo_agrupa[]=this.jcmbx_depaclasif.getSelectedItem().toString().split(":");
        String texto="";
        String descrip=this.jta_descripcion.getText().replace("\n", " ");
        java.util.Date fechaa=new Date();
        
        String agrupar=this.fechaeuropea(fechaa)+"-"+fechaa.getHours()+"-"+fechaa.getMinutes()+"_"+fechaa.getSeconds();
        String confirma="";
        texto="select * from x1_supervision_tareas_insert("+Integer.valueOf(arreglo_agrupa[0])+",'"+agrupar.replace("-", "")+"','"+descrip.toUpperCase()+"','"+this.fechaamericana(this.jdc_fechainicial.getDate())+"','"+this.jtf_horarealiza.getText().toUpperCase()+"',"+Integer.valueOf(arreglo_dep[0])+","+Integer.valueOf(arreglo_tipo[0])+","+Integer.valueOf(arreglo_priori[0])+","+Integer.valueOf(variables_global.getdepartamento())+");";
        System.out.println(agrupar);
          
            try
            {
                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                
               while (rs.next())
                    {
                      confirma=rs.getString(1);
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         if (confirma.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias tu Tarea ha sido Guardada Correctamente", "Sistema Integral Tareas",1);

              }
       this.cargar_datoscata_tareas(0,"",variables_global.getdepartamento());
       this.jcmbox_depart.setSelectedIndex(0);
       this.jta_descripcion.setText("");
       this.jtf_horarealiza.setText("");
       this.jcmbx_tipo.setSelectedIndex(0);
       this.jcmbx_Prioridad.setSelectedIndex(0);
       this.jcmbx_depaclasif.setSelectedIndex(0);
       
         
    }
 private String fechaamericana(Date fe) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fe);
       return cadenafecha;

    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new supervision_tareas_programacion().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JButton jbtn_actualiza;
    private javax.swing.JButton jbtn_grafica;
    private javax.swing.JButton jbtn_guardar;
    private javax.swing.JButton jbtn_salir;
    private javax.swing.JCheckBox jcbx_pendientes;
    private javax.swing.JCheckBox jcbx_verpendienteshoy;
    private javax.swing.JComboBox jcmbox_depart;
    private javax.swing.JComboBox jcmbx_Prioridad;
    private javax.swing.JComboBox jcmbx_asignadoa;
    private javax.swing.JComboBox jcmbx_depaclasif;
    private javax.swing.JComboBox jcmbx_tipo;
    private com.toedter.calendar.JDateChooser jdc_fechainicial;
    private javax.swing.JMenuItem jmni_actualizar;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JTable jt_cattareas;
    private javax.swing.JTextArea jta_descripcion;
    private javax.swing.JTextField jtf_horarealiza;
    // End of variables declaration//GEN-END:variables

}
